package common.service.impl;

import com.baomidou.dynamic.datasource.annotation.DS;
import common.config.datasource.DataSourceConstants;
import common.mapper.CommonMapper;
import common.service.CommonService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 描述
 *
 * @author 米泽鹏
 * @since 2023-10-25 下午 3:41
 */
@Service
public class CommonServiceImpl implements CommonService {

	@Resource
	private CommonMapper commonMapper;

	@Override
	@DS(DataSourceConstants.INFORMATION_SCHEMA_DATASOURCE)
	public List<String> getAllTableName(String database) {
		return commonMapper.getAllTableName(database);
	}

	@Override
	public int updateOperator(String tableName, String oldOperator, String newOperator) {
		return commonMapper.updateOperator(tableName, oldOperator, newOperator);
	}

}
